package com.study.springannotation;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.study.springannotation.beans.Person;

/**
 * 
 * 参考资料 ： http://www.ibm.com/developerworks/cn/opensource/os-cn-spring-iocannt/
 * 
 * @author Jimmy.Qiu
 */
public class App {
	public static void main(String[] args) {
		ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
				"applicationContext.xml");

		Person pserson = (Person) ctx.getBean("person");
		pserson.dosomething();

		// 会触发所有 @PreDestroy 方法
		ctx.destroy();
	}
}